package com.ymatou.iapi.hunter.testcase;

import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.experimental.categories.Category;

import com.ymatou.iapi.hunter.paramater.ApplyHunterUpgradeRequest;
import com.ymatou.iapi.hunter.service.ApplyHunterUpgradeCall;
import com.ymt.core.tool.Logger;
import com.ymt.utils.annotation.TestCase;
import com.ymt.utils.tag.P1;

/**
 * 由业务方覆盖
 * 原因：调用接口造数据困难，需要直接通过修改数据库
 */
@Ignore
public class Ts_ApplyHunterUpgrade {
	
	private static ApplyHunterUpgradeRequest applyHunterUpgradeRequest;
	private static ApplyHunterUpgradeCall applyHunterUpgradeCall;

	@BeforeClass
	public static void setUp() {
		Logger.createResultFile("推手升级申请");
	}

	@Before
	public void caseUp() {
		applyHunterUpgradeRequest = new ApplyHunterUpgradeRequest();
		applyHunterUpgradeCall = new ApplyHunterUpgradeCall();
	}

	@AfterClass
	public static void tearDown() {
		Logger.generateResult(applyHunterUpgradeCall.getOpurl());
	}

	@After
	public void caseDown() {
		Logger.end();
	}
	
	public void verify() {
		
	}
	
	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_ApplyHunterUpgrade_001() {
		Logger.start(true, "同意推手升级");
		try {
			applyHunterUpgradeRequest.setHunterId(1234L);
			applyHunterUpgradeRequest.setReason("reason");
			
			applyHunterUpgradeCall.setData(applyHunterUpgradeRequest);
			applyHunterUpgradeCall.callService();
			
			Logger.verifyEquals("success", applyHunterUpgradeCall.getResponseData().getString("resultMessage"),
					"验证resultMessage");
			Logger.verifyEquals("code", applyHunterUpgradeCall.getResponseData().getInt("resultCode"),
					"验证resultCode");
			Logger.verifyEquals(true, applyHunterUpgradeCall.getResponseData().getBoolean("success"),
					"验证success");
			
			verify();
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
}
